{% extends "endo/admin/admin_base.html" %}

{% block title %}Index of all endorsements{% endblock %}

{% block article %}

    <h1>Index of all endorsements</h1>
    <p><a href="{% url endo_admin_create %}">New endorsement</a></p>
    <h2>Existing endorsements</h2>
    {% if endorsements %}
        {% for endorsement in endorsements %}
            <div>
                <a href="{% url endo_admin_edit endorsement.slug %}">{{ endorsement.slug }}</a>
                <form action="{% url endo_admin_delete %}" method="POST">
                    <input type="hidden" name="slug" value="{{ endorsement.slug }}">
                    <input type="submit" value="Delete">
                </form>
            </div>
        {% endfor %}
    {% else %}
       <p>No endorsements yet.</p>
    {% endif %}
{% endblock %}